package com.example.makerspace.controller;

import com.example.makerspace.dto.NewsDTO;
import com.example.makerspace.dto.Result;
import com.example.makerspace.service.GuideService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Controller
@ResponseBody
@RequestMapping("/api/guide")
public class GuideController {

    @Resource
    private GuideService guideService;

    @GetMapping("/latestNews")
    public Result latestNewsList(){
        return guideService.latestNewsList();
    }

    @PostMapping("/newsDetail")
    public Result newsDetail(@RequestBody NewsDTO newsDTO){
        return guideService.newsDetail(newsDTO);
    }

    @GetMapping("/recommendNews")
    public Result recommendNews(){
        return guideService.recommendNews();
    }

    @GetMapping("/visit")
    public Result visit(){
        return guideService.visit();
    }

}
